home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-28 | 610 b | 36 lines | [TEXT/CWIE] |
- // Buffer.cp
-
- #ifndef Bufferr_h
- #include "Buffer.h"
- #endif
- #ifndef ConstBuffer_h
- #include "ConstBuffer.h"
- #endif
-
- Buffer::Buffer( Data theSpace )
- : space( theSpace ),
- mark( 0 )
- {
- Assert( !theSpace.Null() );
- }
-
- void Buffer::Reset( Data theSpace )
- {
- Assert( !theSpace.Null() );
- space = theSpace;
- mark = 0;
- }
-
- void Buffer::operator<<( ConstData toWrite )
- {
- Assert( toWrite.Length() <= UnusedLength() );
- mark += Unused() << toWrite;
- }
-
- void Buffer::operator<<( ConstBuffer& source )
- {
- uint32 amount = Unused() << source.Unused();
- AdvanceMark( amount );
- source.AdvanceMark( amount );
- }
-